package com.mxpio.erp.common.plm.vo;

import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

//@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "项目成员负责工单")
public class ProjectPeopleVO implements Serializable, DictAble {
    private static final long serialVersionUID=1L;

    /**
     * 项目成员名
     */
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String name;
    /**
     * 负责任务说
     */
    private Integer headTasks;
    /**
     * 参与任务数
     */
    private Integer joinTasks;
    /**
     * 负责问题数
     */
    private Integer headQuestions;

    /**
     * 完成任务数量
     */
    private Integer finishTasks;
    /**
     * 按时完成任务数量
     */
    private Integer onTimeTasks;
    /**
     * 执行中任务数量
     */
    private Integer executeTasks;
    /**
     * 待启动任务数量
     */
    private Integer toBeStartedTasks;


    @Transient
    private Map<String, String> textMap;
    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }
}
